/*
 *  Copyright 2011 - Giovanni Tosto
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package org.softwareforge.struts2.breadcrumb;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * @author Giovanni Tosto
 * @version $Id: Crumb.java 293 2011-06-14 22:10:50Z giovanni.tosto $
 */

public class Crumb implements Serializable {
    private static final long serialVersionUID = 1L;

    Date timestamp;

    String name;

    String namespace;

    String method;

    Map params;

    String action;

    public Date getTimestamp() {
	return timestamp;
    }

    public void setTimestamp(Date timestamp) {
	this.timestamp = timestamp;
    }

    public String getName() {
	return name;
    }

    void setName(String name) {
	this.name = name;
    }

    public String getAction() {
	return action;
    }

    public String getNamespace() {
	return namespace;
    }

    public String getMethod() {
	return method;
    }

    public Map getParams() {
	return params;
    }

    public void setParams(Map params) {
	this.params = params;
    }

    // public String getFullyQualifiedId() {
    // return namespace + "/" + action + "!" + method + ":" + name;
    // }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((action == null) ? 0 : action.hashCode());
	result = prime * result + ((method == null) ? 0 : method.hashCode());
	result = prime * result + ((name == null) ? 0 : name.hashCode());
	result = prime * result
		+ ((namespace == null) ? 0 : namespace.hashCode());
	return result;
    }
}
